package com.cxt.utils;

import com.cxt.model.XYTimeCapacity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class XYTimeCapacityUtil {
    //算法类型常量
    public static final Integer AVERAGE = 1;
    private static List<XYTimeCapacity> capacity;
    //创建坐标系
    public static void create(){
        capacity = new ArrayList<>();
    }
    //添加数据
    public static void add(XYTimeCapacity xyTimeCapacity){
        capacity.add(xyTimeCapacity);
    }
    //计算增长率，参数是算法类型
    public static Double calculateGrowthRate(Integer type){
        if (Objects.equals(type, AVERAGE)){
            return average();
        }
        return 0.0;
    }
    //计算预计满的时间
    public static Double  calculateFullTime(){
        return 0.0;
    }
    //清空数据
    public static void clear(){
        capacity.clear();
    }
    //关闭坐标系
    public static void close(){
        capacity = null;
    }


    //算法
    private static Double average(){
        return 0.0;
    }

}
